package com.weixin.paleituo.activity;

import android.content.Context;
import android.content.Intent;
import android.support.v4.content.ContextCompat;
import android.view.View;

import com.weixin.paleituo.R;
import com.weixin.paleituo.base.BasePersonActivity;
import com.weixin.paleituo.eventbus.UpdataBrokerageEvent;
import com.weixin.paleituo.eventbus.WithDrawEventBus;
import com.weixin.paleituo.util.UIUtils;

import org.greenrobot.eventbus.EventBus;

/**
 * 提现成功界面，点击完成/物理返回，跳转佣金提现中界面
 *
 * @author fengzhen
 * @version v1.0, 2018/5/14
 */
public class WithdrawSuccessActivity extends BasePersonActivity {

    public static Intent call2WithdrawSuccessActivity(Context context) {
        Intent intent = new Intent(context, WithdrawSuccessActivity.class);
        return intent;
    }

    @Override
    protected void initData() {
        super.initData();
        mIvBack.setVisibility(View.GONE);
        mTvTitle.setText("提现");
        mTvSmalTitle.setText("完成");
        mTvSmalTitle.setVisibility(View.VISIBLE);
        mTvSmalTitle.setTextColor(ContextCompat.getColor(this, R.color.c_29CE7E));
    }

    @Override
    protected void save(View v) {
        super.save(v);
        onBackPressed();
    }

    @Override
    public void onBackPressed() {
        startActivity(MyBrokerageActivity.call2MyBrokerageActivity(this, 1));
        EventBus.getDefault().post(new WithDrawEventBus(1));
        EventBus.getDefault().post(new UpdataBrokerageEvent());
        super.onBackPressed();
    }

    @Override
    protected View getContentView(Context context) {
        return UIUtils.inflate(this, R.layout.activity_withdraw_success);
    }
}
